package cn.codeforfun.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.camunda.bpm.engine.repository.ProcessDefinition;

/**
 * @author wangbin
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProcessDefinitionVO {
    private String id;
    private String name;
    private String description;
    private String key;
    private Integer version;
    private String deploymentId;

    public static ProcessDefinitionVO from(ProcessDefinition source) {
        ProcessDefinitionVO target = new ProcessDefinitionVO();
        target.setId(source.getId());
        target.setName(source.getName());
        target.setDescription(source.getDescription());
        target.setKey(source.getKey());
        target.setVersion(source.getVersion());
        target.setDeploymentId(source.getDeploymentId());
        return target;
    }
}
